import processing.serial.*;
Serial myPort;
char start;
int diam;           //Declare diameter
int y;  
int x;
color c;            //Declare c is the color
int j;
boolean button = false;

void setup() {
size( 1300, 676 );                 // size of screen
String portName = Serial.list()[0];
myPort = new Serial(this, portName, 9600);
smooth();
strokeWeight( 2 );
x = width/2;                      
y = height/2;
diam = 200;   
c   = color(255,255,255);
}

void draw() {
  background (255);
  
 if(myPort.available() > 0){
  start = char(myPort.read());
 }
     switch (start){
       case 'A':
       c = color( 255, 0, 0 ); //red color
       fill( c );
       ellipse( x, y, diam*2, diam*2 ); 
       break;
       case 'B':
       c =color( 255, 255, 0 ); //yelow color
       fill( c );
       ellipse( x, y, diam*2, diam*2 ); 
       break;
       case 'C':
       c =  color( 0, 255, 0 ); //green color
       fill( c );
       ellipse( x, y, diam*2, diam*2 ); 
       break;
       default:                // white color 
       c =  color( 255, 255, 255);
       fill(c);
       break;
    }
    
    
    
}

  



  


